﻿<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.yuhang.entity.HyAdmin" %>
<%@ page import="com.yuhang.entity.HyRepair" %>
<%@ page import="com.yuhang.entity.HyUser" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>小区管理系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="css/main.css" media="all">
    <link rel="stylesheet" href="css/font.css">
    <link rel="stylesheet" href="layui/css/layui.css">
</head>
<body>

<div class="layui-layout layui-layout-admin">
    <!--顶部导航栏开始-->
    <div class="layui-header header header-demo">
        <div class="layui-main">
            <div class="admin-logo-box">
                <a class="logo" href="" title="logo">小区物业管理系统</a>
            </div>

            <ul class="layui-nav" lay-filter="">
                <li class="layui-nav-item" id="time" style="margin-right: 50px;font-size: 16px;color: #2fb9d4;position: absolute;left: -250px;top: 0"></li>
                <div id="admin2">
                    <li class="layui-nav-item"><img src="${sessionScope.hyAdmin.photo}" class="layui-circle" style="border: 2px solid #A9B7B7;" width="35px" height="35px" alt=""></li>
                    <li class="layui-nav-item"> <a href="javascript:;">${sessionScope.hyAdmin.username}</a>
                        <dl class="layui-nav-child">
                            <dd><a href="javascript:;"  onclick="one_set('个人信息','updateAdmin.jsp','1000','600')">个人信息</a></dd>
                            <dd><a href="javascript:;" onclick="logout()">退出</a></dd>
                        </dl>
                    </li>
                </div>
                <div id="repair2">
                    <li class="layui-nav-item"><img src="${sessionScope.hyRepair.photo}" class="layui-circle" style="border: 2px solid #A9B7B7;" width="35px" height="35px" alt=""></li>
                    <li class="layui-nav-item"> <a href="javascript:;">${sessionScope.hyRepair.name}</a>
                        <dl class="layui-nav-child">
                            <dd><a href="javascript:;"  onclick="one_set('个人信息','updateRepair.jsp','1000','600')">个人信息</a></dd>
                            <dd><a href="javascript:;" onclick="logout()">退出</a></dd>
                        </dl>
                    </li>
                </div>
                <div id="user2">
                    <li class="layui-nav-item"><img src="${sessionScope.hyUser.userPhoto}" class="layui-circle" style="border: 2px solid #A9B7B7;" width="35px" height="35px" alt=""></li>
                    <li class="layui-nav-item"> <a href="javascript:;">${sessionScope.hyUser.name}</a>
                        <dl class="layui-nav-child">
                            <dd><a href="javascript:;" onclick="one_set('个人信息','updateUser.jsp','1000','600')">个人信息</a></dd>
                            <dd><a href="javascript:;" onclick="logout()">退出</a></dd>
                        </dl>
                    </li>
                </div>

            </ul>
        </div>
    </div>
    <!--顶部导航栏结束-->

    <!--左侧导航区域开始-->

    <div class="layui-side layui-bg-black x-side show_list" style="left:0px;" id="table1">
        <div style="height: 130px; width: 220px; " id="admin1">
            <a class="img" title="我的头像" style="display: block;width: 80px;height: 80px;margin: 10px auto 10px;">
                <img src="${sessionScope.hyAdmin.photo}" class="userAvatar" style="display: block;width: 100%;height: 100%;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;border: 4px solid #44576b;box-sizing: border-box;">
            </a>
            <p style=" display: block;width: 100%;height: 25px;color: #ffffff;text-align: center;font-size: 12px;white-space: nowrap;line-height: 25px;overflow: hidden;">
                你好！<span class="userName">${sessionScope.hyAdmin.username}</span>, 欢迎回来
            </p>
        </div>


        <div class="layui-side-scroll">

            <ul class="layui-nav layui-nav-tree site-demo-nav" lay-filter="side">


                <li class="layui-nav-item"> <a class="javascript:;" href="javascript:;" _href="welcome.jsp"> <i class="layui-icon left-nav-li" lay-tips="首页">&#xe68e;</i><cite>控制台</cite> </a>
                </li>

                <li class="layui-nav-item"> <a class="javascript:;" href="javascript:;"> <i class="layui-icon iconfont icon-yezhuxian" style="top: 3px;"></i><cite>业主信息管理</cite> </a>
                    <dl class="layui-nav-child">
                        <dd class="">
                        <dd class=""> <a href="javascript:;" _href="userList.jsp"> <cite>人员管理</cite> </a> </dd>
                        <dd class=""> <a href="javascript:;" _href="carList.jsp"> <cite>车辆管理</cite> </a> </dd>
                        <dd class=""> <a href="javascript:;" _href="petList.jsp"> <cite>宠物管理</cite> </a> </dd>
                        </dd>
                    </dl>
                </li>

                <li class="layui-nav-item"> <a class="javascript:;" href="javascript:;"> <i class="layui-icon iconfont icon-shoufeizhan" style="top: 3px;"></i><cite>收费管理</cite> </a>
                    <dl class="layui-nav-child">
                        <dd class=""> <a href="javascript:;" _href="billList.jsp"> <cite>缴费信息</cite> </a> </dd>
                        <dd class=""> <a href="javascript:;" _href="billStreamList.jsp"> <cite>缴费统计</cite> </a> </dd>
                    </dl>
                </li>

                <li class="layui-nav-item"> <a class="javascript:;" href="javascript:;"> <i class="layui-icon iconfont icon-fuwu" style="top: 3px;"></i><cite>服务管理</cite> </a>
                    <dl class="layui-nav-child">
                        <dd class=""> <a href="javascript:;" _href="activityList.jsp"> <cite>活动管理</cite> </a> </dd>
                        <dd class=""> <a href="javascript:;" _href="complaintsList.jsp"> <cite>投诉管理</cite> </a> </dd>
                    </dl>
                </li>

                <li class="layui-nav-item"> <a class="javascript:;" href="javascript:;"> <i class="layui-icon layui-icon-util" style="top: 3px;"></i><cite>维修管理</cite> </a>
                    <dl class="layui-nav-child">
                        <dd class=""> <a href="javascript:;" _href="repairList.jsp"> <cite>维修人员管理</cite> </a> </dd>
                        <dd class=""> <a href="javascript:;" _href="repairStreamList.jsp"> <cite>维修信息管理</cite> </a> </dd>
                    </dl>
                </li>

                <li class="layui-nav-item"> <a class="javascript:;" href="javascript:;"> <i class="layui-icon layui-icon-friends" style="top: 3px;"></i><cite>管理员管理</cite> </a>
                    <dl class="layui-nav-child">
                        <dd class=""> <a href="javascript:;" _href="adminList.jsp"> <cite>管理员列表</cite> </a> </dd>
                    </dl>
                </li>

            </ul>
        </div>
    </div>


    <div class="layui-side layui-bg-black x-side show_list" style="left:0px;" id="table2">
        <div style="height: 130px; width: 220px; " id="repair1">
            <a class="img" title="我的头像" style="display: block;width: 80px;height: 80px;margin: 10px auto 10px;">
                <img src="${sessionScope.hyRepair.photo}" class="userAvatar" style="display: block;width: 100%;height: 100%;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;border: 4px solid #44576b;box-sizing: border-box;">
            </a>
            <p style=" display: block;width: 100%;height: 25px;color: #ffffff;text-align: center;font-size: 12px;white-space: nowrap;line-height: 25px;overflow: hidden;">
                你好！<span class="userName">${sessionScope.hyRepair.name}</span>, 欢迎回来
            </p>
        </div>
        <div class="layui-side-scroll">

            <ul class="layui-nav layui-nav-tree site-demo-nav" lay-filter="side">

                <li class="layui-nav-item"> <a class="javascript:;" href="javascript:;" _href="welcome.jsp"> <i class="layui-icon left-nav-li" lay-tips="首页">&#xe68e;</i><cite>控制台</cite> </a>
                </li>

                <li class="layui-nav-item"> <a class="javascript:;" href="javascript:;"> <i class="layui-icon layui-icon-util" style="top: 3px;"></i><cite>维修管理</cite> </a>
                    <dl class="layui-nav-child">
                        <dd class=""> <a href="javascript:;" _href="jdrepairStreamList.jsp"> <cite>维修接单</cite> </a> </dd>
                        <dd class=""> <a href="javascript:;" _href="repairStream.jsp"> <cite>维修信息查询</cite> </a> </dd>
                    </dl>
                </li>

            </ul>
        </div>
    </div>


    <div class="layui-side layui-bg-black x-side show_list" style="left:0px;" id="table3">
        <div style="height: 130px; width: 220px; " id="user1">
            <a class="img" title="我的头像" style="display: block;width: 80px;height: 80px;margin: 10px auto 10px;">
                <img src="${sessionScope.hyUser.userPhoto}" class="userAvatar" style="display: block;width: 100%;height: 100%;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;border: 4px solid #44576b;box-sizing: border-box;">
            </a>
            <p style=" display: block;width: 100%;height: 25px;color: #ffffff;text-align: center;font-size: 12px;white-space: nowrap;line-height: 25px;overflow: hidden;">
                你好！<span class="userName">${sessionScope.hyUser.name}</span>, 欢迎回来
            </p>
        </div>
        <div class="layui-side-scroll">

            <ul class="layui-nav layui-nav-tree site-demo-nav" lay-filter="side">

                <li class="layui-nav-item"> <a class="javascript:;" href="javascript:;" _href="welcome.jsp"> <i class="layui-icon left-nav-li" lay-tips="首页">&#xe68e;</i><cite>控制台</cite> </a>
                </li>

                <li class="layui-nav-item"> <a class="javascript:;" href="javascript:;"> <i class="layui-icon iconfont icon-yezhuxian" style="top: 3px;"></i><cite>业主信息管理</cite> </a>
                    <dl class="layui-nav-child">
                        <dd class="">
                        <dd class=""> <a href="javascript:;" _href="userCarList.jsp"> <cite>车辆管理</cite> </a> </dd>
                        <dd class=""> <a href="javascript:;" _href="userPetList.jsp"> <cite>宠物管理</cite> </a> </dd>
                        </dd>
                    </dl>
                </li>

                <li class="layui-nav-item"> <a class="javascript:;" href="javascript:;"> <i class="layui-icon iconfont icon-shoufeizhan" style="top: 3px;"></i><cite>收费管理</cite> </a>
                    <dl class="layui-nav-child">
                        <dd class=""> <a href="javascript:;" _href="userBillList.jsp"> <cite>缴费信息</cite> </a> </dd>
                        <dd class=""> <a href="javascript:;" _href="userBillStreamList.jsp"> <cite>缴费统计</cite> </a> </dd>
                    </dl>
                </li>

                <li class="layui-nav-item"> <a class="javascript:;" href="javascript:;"> <i class="layui-icon iconfont icon-fuwu" style="top: 3px;"></i><cite>服务管理</cite> </a>
                    <dl class="layui-nav-child">
                        <dd class=""> <a href="javascript:;" _href="userActivityList.jsp"> <cite>活动管理</cite> </a> </dd>
                        <dd class=""> <a href="javascript:;" _href="userComplaintsList.jsp"> <cite>投诉管理</cite> </a> </dd>
                        <dd class=""> <a href="javascript:;" _href="userRepairStreamList.jsp"> <cite>维修信息管理</cite> </a> </dd>
                    </dl>
                </li>

            </ul>
        </div>
    </div>


    <!--左侧导航区域结束-->

    <!--首页界面开始-->
    <div class="layui-tab layui-tab-card site-demo-title x-main" lay-filter="x-tab" lay-allowclose="true" style="left: 220px;border-left: solid 2px #2299ee;">
        <ul class="layui-tab-title">
            <li class="layui-this"> 我的桌面 <i class="layui-icon layui-unselect layui-tab-close">ဆ</i> </li>
        </ul>
        <div class="layui-tab-content site-demo site-demo-body">
            <div class="layui-tab-item layui-show">
                <iframe frameborder="0" src="welcome.jsp" class="x-iframe"></iframe>
            </div>
        </div>
    </div>
    <!--首页界面结束-->
    <div class="site-mobile-shade"> </div>

</div>
<script type="text/javascript" src="lib/loading/okLoading.js"></script>
<script src="lib/layui/layui.js" charset="utf-8"></script>
<script src="js/main.js"></script>
<script src="js/jquery.min.js"></script>
<script src="js/x-layui.js" charset="utf-8"></script>

<script>
    $(window).on('load',function(){
        let item = localStorage.getItem("code");
        if (item != 0) {
            window.location.href = "/login.jsp"
        }
        var state = '<%= session.getAttribute("state")%>';
        console.log(state);
        if(state==1){
            $("#table2").attr("style","display:none;");
            $("#table3").attr("style","display:none;");
            $("#updateRepair").attr("style","display:none;");
            $("#updateUser").attr("style","display:none;");
            $("#repair2").attr("style","display:none;");
            $("#user2").attr("style","display:none;");
        }else if(state==2){
            $("#table1").attr("style","display:none;");
            $("#table3").attr("style","display:none;");
            $("#updateAdmin").attr("style","display:none;");
            $("#updateUser").attr("style","display:none;");
            $("#admin2").attr("style","display:none;");
            $("#user2").attr("style","display:none;");
        }else if(state==3){
            $("#table1").attr("style","display:none;");
            $("#table2").attr("style","display:none;");
            $("#updateRepair").attr("style","display:none;");
            $("#updateAdmin").attr("style","display:none;");
            $("#admin2").attr("style","display:none;");
            $("#repair2").attr("style","display:none;");
        }
    });

</script>

<script>
    layui.use(['laydate','element','laypage','layer'], function(){
        $ = layui.jquery;//jquery
        laydate = layui.laydate;//日期插件
        element = layui.element();//面包导航
        laypage = layui.laypage;//分页
        layer = layui.layer;//弹出层
        okLoading.close($)
        //以上模块根据需要引入

    });




</script>
<script>
    //顶部时间
    function getTime(){
        var myDate = new Date();
        var myYear = myDate.getFullYear(); //获取完整的年份(4位,1970-????)
        var myMonth = myDate.getMonth()+1; //获取当前月份(0-11,0代表1月)
        var myToday = myDate.getDate(); //获取当前日(1-31)
        var myDay = myDate.getDay(); //获取当前星期X(0-6,0代表星期天)
        var myHour = myDate.getHours(); //获取当前小时数(0-23)
        var myMinute = myDate.getMinutes(); //获取当前分钟数(0-59)
        var mySecond = myDate.getSeconds(); //获取当前秒数(0-59)
        var week = ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'];
        var nowTime;

        nowTime = myYear+'-'+fillZero(myMonth)+'-'+fillZero(myToday)+'&nbsp;&nbsp;'+week[myDay]+'&nbsp;&nbsp;'+fillZero(myHour)+':'+fillZero(myMinute)+':'+fillZero(mySecond);
        $('#time').html(nowTime);
    };

    function fillZero(str){
        var realNum;
        if(str<10){
            realNum	= '0'+str;
        }else{
            realNum	= str;
        }
        return realNum;
    }
    setInterval(getTime,1000);
</script>

<script>

    function one_set(title,url,w,h){
        x_admin_show(title,url,w,h);
    }

    function logout() {
        layer.confirm('是否确认退出？',function (ss) {
            $.ajax({
                url: "http://localhost:8888/hy-admin/logout",
                dataType: "json",
                type: "post",
                success: function (res) {
                    if (res.code == 0) {
                        localStorage.removeItem("code");
                        //关闭弹出层
                        layer.closeAll();
                        window.location.href = 'login.jsp';
                    }
                }
            });
            layer.close(ss);
        });
    }


</script>


</body>
</html>